import 'package:fish_redux/fish_redux.dart';
import 'package:www.znpigai.teacher/home_page/subject_tab_component/item/state.dart';

import 'action.dart';

Reducer<SubjectState> buildReducer() {
  return asReducer(
    <Object, Reducer<SubjectState>>{
      SubjectAction.result: _result,
    },
  );
}

SubjectState _result(SubjectState state, Action action) {
  return SubjectState.fromJson(action.payload)..self = state.self;
}
